package com.monkey.model.monkey;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * desc:
 * auth: chenxiaobin
 * data: 2018/1/13.
 */
public class MonkeyData {
    private int monkeyId;
    private int dadId;
    private int monId;
    private int generation;
    private int weight;
    private int growOrigin;
    private int reproductOrigin;
    private int bonusOrigin;
    private int grow;
    private int reproduct;
    private int bonus;
    private int reproductCount;
    private String reproductCD;
    private long reproductCD1;
    private int bonusCount;
    private BigDecimal bonusYesterday;
    private BigDecimal bonusTotal;
    private String uuid;
    private int status;
    private int data1;
    private float price;
    private int feedCount;
    private int feedMoney;
    private String createTime;
    private int element;

    public MonkeyData(Monkey monkey, SimpleDateFormat sdf) {
        this.monkeyId = monkey.getId();
        this.dadId = monkey.getDadId();
        this.monId = monkey.getMonId();
        this.generation = monkey.getGeneration();
        this.weight = monkey.getWeight();
        this.growOrigin = monkey.getGrowOrigin();
        this.reproductOrigin = monkey.getReproductOrigin();
        this.bonusOrigin = monkey.getBonusOrigin();
        this.grow = monkey.getGrow();
        this.reproduct = monkey.getReproduct();
        this.bonus = monkey.getBonus();
        this.reproductCount = monkey.getReproductCount();
        Date now = new Date();
        if (monkey.getReproductCD().before(now)) {
            this.reproductCD = "准备就绪";
            this.reproductCD1 = 0;
        } else {
            this.reproductCD = sdf.format(monkey.getReproductCD());
            this.reproductCD1 = (monkey.getReproductCD().getTime() - now.getTime()) / 1000;
        }
        this.bonusCount = monkey.getBonusCount();
        this.bonusYesterday = monkey.getBonusYesterday();
        this.bonusTotal = monkey.getBonusTotal();
        this.uuid = monkey.getUuid();
        this.status = monkey.getStatus();
        this.data1 = monkey.getData1();
        this.price = 0.0f;
        this.feedCount = monkey.getFeedCount();
        this.feedMoney = monkey.getFeedMoney();
        this.createTime = sdf.format(monkey.getCreateTime());
        this.element = monkey.getElement();
    }

    public int getMonkeyId() {
        return monkeyId;
    }

    public int getDadId() {
        return dadId;
    }

    public int getMonId() {
        return monId;
    }

    public int getGeneration() {
        return generation;
    }

    public float getWeight() {
        return weight * 1.0f / 100;
    }

    public float getGrowOrigin() {
        return growOrigin * 1.0f / 100;
    }

    public float getReproductOrigin() {
        return reproductOrigin * 1.0f / 100;
    }

    public float getBonusOrigin() {
        return bonusOrigin * 1.0f / 100;
    }

    public float getGrow() {
        return grow * 1.0f / 100;
    }

    public int getReproductCount() {
        return reproductCount;
    }

    public float getReproduct() {
        return reproduct * 1.0f / 100;
    }

    public float getBonus() {
        return bonus * 1.0f / 100;
    }

    public String getReproductCD() {
        return reproductCD;
    }

    public long getReproductCD1() {
        return reproductCD1;
    }

    public int getBonusCount() {
        return bonusCount;
    }

    public BigDecimal getBonusYesterday() {
        return bonusYesterday;
    }

    public BigDecimal getBonusTotal() {
        return bonusTotal;
    }

    public String getUuid() {
        return uuid;
    }

    public int getStatus() {
        return status;
    }

    public int getData1() {
        return data1;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public int getFeedCount() {
        return feedCount;
    }

    public int getFeedMoney() {
        return feedMoney;
    }

    public String getCreateTime() {
        return createTime;
    }
    
    public int getElement() {
        return element;
    }
}
